package com.mxz.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.mxz.manage.pojo.User;
import com.mxz.manage.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * Created by Administrator on 2018/5/6.
 */
@RestController
@RequestMapping(value = "/user")
public class UserController {

    @Reference
    private UserService userService;

    @RequestMapping("index")
    public List<User> index(){

        List<User> all = userService.getAll();

        System.out.println("客户端读取到数据: " + all);

        return all;
    }

    @GetMapping("test")
    public String test(){
        return "usercontroller / test ";
    }

}
